@ECHO OFF

REM
REM Define the version.
REM
CLS
ECHO +-----------------------------------------------------------------------------+
ECHO ^|                                                                             ^|
ECHO ^|                 PLEASE DEFINE YOUR SALESFORCE VERSION                       ^|
ECHO ^|                                                                             ^|
ECHO +-----------------------------------------------------------------------------+
REM Task menu.
ECHO Please select your Task :
ECHO 1. Retrieve
ECHO 2. Package
ECHO 3. Simulate
ECHO 4. Deploy
ECHO 5. exit
CHOICE /C:12345
SET TASK=%ERRORLEVEL%
IF %TASK% EQU 5 GOTO END

REM Version.
ECHO.
SET /P SF_VERSION=Please define your Salesforce version : 
SET VERSION_HOME=%CD%\Versions\%SF_VERSION%

REM Switch by menu.
IF %TASK% EQU 1 GOTO RETRIEVE
IF %TASK% EQU 2 GOTO PACKAGE
IF %TASK% EQU 3 GOTO SIMULATE
IF %TASK% EQU 4 GOTO DEPLOY

:RETRIEVE
SET CMDEXEC=SF_ACTIONS.BAT r %VERSION_HOME%
GOTO EXEC

:PACKAGE
SET CMDEXEC=PACKAGE.BAT %VERSION_HOME% version.properties
GOTO EXEC

:SIMULATE
SET CMDEXEC=SF_ACTIONS.BAT s %VERSION_HOME%
GOTO EXEC

:DEPLOY
SET CMDEXEC=SF_ACTIONS.BAT d %VERSION_HOME%

:EXEC
CD .\Config\
CALL %CMDEXEC%

:END
PAUSE